<#include "../common/_header.htm">
<div id="hidebox" style="height:100%;width:100%">
    <form action="" method="post" id="editCon">
		<div class="form-group">
	        <label class="control-label userName">交易主体：</label>
	        <input type="text" class="form-control nameInp" name="nodeText" disabled="disabled"/>
	        <input type="hidden" name="cardNumbers"/>
		</div>
		<div class="form-group">
			<span class="iconfont icon-jiufuqianbaoicon14"></span>
			<label class="control-label userName">删除原因：</label>
			<input class="form-control nameInp" type="text" name="operationReason" required="required"/>
		</div>
		<div class="editSure">
            <button type="button" onclick="deletePersonInformation()" class="el-button el-button--primary editSureBtn">删除</button>
        </div>
	</form>
</div>
<script type="text/javascript">
	var dialog = top.dialog.get(window);
	window.onload = function (){
		$('input[name="nodeText"]').val(dialog.data.accountBody);
		$('input[name="cardNumbers"]').val(dialog.data.cardNumbers);
	};
	/*删除*/
	function deletePersonInformation(){
		var nodeText = dialog.data.accountBody;
		var operationReason = $('input[name="operationReason"]').val();
		if(!isNotEmpty(operationReason) || !notCantSpace(operationReason)){
			toastr.error("不能为空或者包含空格","提示信息");
			return;
		}
		var data = { 
			"nodeText" : dialog.data.accountBody,
			"cardNumbers" : dialog.data.cardNumbers,
			"operationReason" : operationReason,
			"caseId":dialog.data.caseId
		};
	    $.ajax({
	    	type : "POST",
	        url : "${ctx}/bill/stream/d3/deleteAccountBody",
	        contentType: "application/json;charset=UTF-8",
	        data : JSON.stringify(data),
	        success : function (date) {
	        	if(date.result = 'success'){
	        		window.parent.location.reload();
	        	}
	        },
	        error : function() {
	        	toastr.error("保存失败","提示信息");
	        }
	    });
	}
	function isNotEmpty(value) {
        if (value == '') {
            return false;
        }
        if ($.trim(value) == '') {
            return false;
        }
        return true
    };
    function notCantSpace(value) {
        if (value == '' || $.trim(value) == '') {
            return true;
        }
        if ($.trim(value).search(/\s/) != -1) {
            return false;
        }
        return true;
    };
</script>
<style type="text/css">
	.editSure {
        padding-top: 30px;
        text-align: center;
    }
    .form-control:focus {
        border-color: #4695ed;
        box-shadow: none;
    }
    span.iconfont.icon-jiufuqianbaoicon14 {
        font-size: 12px;
        margin-left: -17px;
        color: red;
    }
    .form-group{
        margin-left: 25px;
    }
    .nameInp{
        display: inline-block;
        width: 220px;
        margin-left: 20px;
        border-radius: 5px;
    }
    #hidebox {
        top: 23px;
        left: 2%;
        border-radius: 5px;
        background-color:#fff;
        z-Index:9999;
        padding: 10px;
        overflow-y: hidden;
    }
</style>
